-- 延迟执行
setTimeout = function(callback, delay)
    return gameapi.add_local_timer(delay / 1000, callback)
end

-- 定时执行
setInterval = function(callback, delay)
    return gameapi.add_local_repeat_timer(delay / 1000, callback)
end

-- 删除定时器
clearTimeout = function(id)
    gameapi.cancel_local_timer(id)
end

-- 删除定时器
clearInterval = function(id)
    gameapi.cancel_local_timer(id)
end
